package com.ansion.commonchat.contact.adapter;

import android.net.Uri;
import android.view.View;

import androidx.annotation.NonNull;

import com.ansion.adapter.ITurboItem;
import com.ansion.adapter.TurboAdapter;
import com.ansion.commonchat.R;
import com.ansion.commonchat.contact.bean.ContactShareBean;
import com.ansion.commonchat.contact.ui.ContactItemType;
import com.ansion.constant.BConstant;


/**
 * 联系人 share
 */
public class ContactShareItem implements ITurboItem<ContactShareItem.VH> {

    @Override
    public int getType() {
        return ContactItemType.ItemTypeShare;
    }

    @Override
    public int getLayoutRes() {
        return R.layout.comm_layout_share;
    }

    @NonNull
    @Override
    public VH getViewHolder(View v) {
        return new VH(v);
    }

    class VH extends TurboAdapter.ViewHolder<ContactShareBean> {

        public VH(View itemView) {
            super(itemView);
        }

        @Override
        public void bindView(ContactShareBean bean, int position) {
            itemView.setOnClickListener(v -> {
//                if (MiniProgramSomaConfig.get().isNewShare()) {
//                    JsonObject data = BotMPUtils.getShareData(BConstant.Share.TYPE_TEXT, BotMPUtils.tellFriend(), false);
//                    JsonObject mpParams = BotMPUtils.getMPParams(BConstant.MPFrom.FROM_CONTACT_SHARE, ALMPThemeData.FORCE_LANDSCAPE_FALSE, null, data);
//                    SchemeExtraData extra = SchemeExtraData.create()
//                            .putString(BConstant.MPFrom.MP_FROM, BConstant.MPFrom.FROM_CONTACT_SHARE)
//                            .putString(BConstant.MP_Params.KEY_MP_PARAMS, mpParams.toString());
//                    PageUtil.dealUri(Uri.parse(BConstant.Share.MP_URL_SHARE_IMSHAREDIALOG), extra);
//                } else {
//                    ShareHelper.popTellFriendDialog(itemView.getContext(), "", BConstant.Share.FROMPAGE_CALLS);
//                }
            });
        }
    }
}
